<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/page/inc/taglib.jsp"%>
<div class="pageHeader">
	<form id="pagerForm" onsubmit="return navTabSearch(this);" action="${pageContext.request.contextPath}/merchant/merchantProduct/list" method="post">
		<!-- 分页表单参数 -->
		<%@include file="/WEB-INF/page/inc/pageForm.jsp"%>
		<!-- 需要排序的字段 -->
		<input type="hidden" name="orderField" value="${requestScope.dwzPageBean.countResultMap.orderField}" />
		<!-- 正序倒序 -->
		<input type="hidden" name="orderDirection" value="${requestScope.dwzPageBean.countResultMap.orderDirection}" />
		<div class="searchBar">
			<table class="searchContent">
				<tr>
					<p>
						<label style="width: 60px;">商品状态：</label> <select name="state" class="combox">
							<option value="0" ${requestScope.dwzPageBean.countResultMap.state == 0 ? 'selected':''}>出售中</option>
							<option value="1" ${requestScope.dwzPageBean.countResultMap.state == 1 ? 'selected':''}>已下架</option>
						</select>
					</p>
					<%-- <td><label style="width: 60px;">商品名称：</label><input type="text" name="productName" value="${requestScope.dwzPageBean.countResultMap.productName}" size="30" placeholder="请输入商品名称" />
					</td> --%>
					<td><label style="width: 60px;">商品名称：</label> <input size="30" placeholder="请输入商品名称" name="org2.productName" type="text" postField="productName" suggestFields="productName" suggestUrl="${pageContext.request.contextPath}/merchant/merchantProduct/getProductName" lookupGroup="org2" value="${requestScope.dwzPageBean.countResultMap.productName}" /></td>
				</tr>
			</table>
			<div class="subBar">
				<ul>
					<li>
						<div class="buttonActive">
							<div class="buttonContent">
								<button type="submit">查询</button>
							</div>
						</div>
					</li>
				</ul>
			</div>
		</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<shiro:hasPermission name="/merchant/merchantProduct/merchantProductexport">
				<li><a href="${pageContext.request.contextPath}/merchant/merchantProduct/merchantProductexport" target="dwzExport" targetType="navTab" title="是要导出这些记录吗?" class="icon"><span>导出EXCEL</span></a></li>
			</shiro:hasPermission>
			<shiro:hasPermission name="/merchant/merchantProduct/toInsert">
				<li><a class="add" href="${pageContext.request.contextPath}/merchant/merchantProduct/toInsert" rel="insert" target="dialog" mask="true" width="820" height="460"><span>添加</span></a></li>
			</shiro:hasPermission>
			<%-- <shiro:hasPermission name="/merchant/merchantProduct/delete">
				<li><a class="delete" href="${pageContext.request.contextPath}/merchant/merchantProduct/delete" rel="id" target="selectedTodo" title="确定要删除吗？" warn="请最小选择一条记录" mask="true"><span>批量删除</span></a></li>
			</shiro:hasPermission> --%>
		</ul>
	</div>
	<table class="table" targetType="navTab" asc="asc" desc="desc" width="100%" layoutH="138">
		<thead>
			<tr>
				<!-- <th width="22"><input type="checkbox" group="id" class="checkboxCtrl"></th> -->
				<th orderField="product_name" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'product_name'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>商品名称</th>
				<th orderField="productTypeName" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'productTypeName'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>商品分类</th>
				<th width="180">操作</th>
			</tr>
		</thead>
		<tbody>
			<c:if test="${requestScope.dwzPageBean != null &&  requestScope.dwzPageBean.recordList != null }">
				<c:forEach var="record" items="${requestScope.dwzPageBean.recordList}" varStatus="status">
					<tr ondblclick="openDetails(this)" target="dialog" href="${pageContext.request.contextPath}/merchant/merchantProduct/toUpdate?id=${record.merchantProductId}" title="编辑">
						<%-- <td><input name="id" value=${record.merchantProductId } type="checkbox"></td> --%>
						<td>${record.productName}</td>
						<%-- <c:forEach items="${requestScope.types}" var="type"> --%>
						<td>${record.productTypeName}</td>
						<%-- </c:forEach> --%>
						<td><shiro:hasPermission name="/merchant/merchantProduct/toUpdate">
								<a title="编辑" mask="true" rel="update" target="dialog" href="${pageContext.request.contextPath}/merchant/merchantProduct/toUpdate?id=${record.merchantProductId}" class="editBtn" width="820" height="460"><span>编辑</span></a>
							</shiro:hasPermission> <shiro:hasPermission name="/merchant/merchantProduct/updateProductState">
								<a title="确定要${record.state==0?'下架':'上架'}吗？" title="确定执行此操作吗？" target="ajaxTodo" href="${pageContext.request.contextPath}/merchant/merchantProduct/updateProductState?id=${record.merchantProductId}" mask="true" class="${record.state != 1?'downloadBtn':'uploadBtn'}"><span>${record.state != 1?'下架':'上架'}</span></a>
							</shiro:hasPermission> <shiro:hasPermission name="/merchant/merchantProductNorm/list">
								<a target="navTab" title="规格设置" rel="${pageContext.request.contextPath}/merchant/merchantProduct/list" href="${pageContext.request.contextPath}/merchant/merchantProductNorm/list?pdid=${record.merchantProductId}" class="normBtn"><span>规格</span></a>
							</shiro:hasPermission></td>
					</tr>
				</c:forEach>
			</c:if>
		</tbody>
	</table>
	<!-- 分页条 -->
	<%@include file="/WEB-INF/page/inc/pageBar.jsp"%>
</div>